@ECHO OFF

cd %1

IF NOT EXIST DS_OUT.COM GOTO BANKCODE


IF EXIST DS_OUT.ABS.plg DEL DS_OUT.ABS.plg

OH51 DS_OUT.COM
DSCHECK.EXE /fDS_OUT.HEX
IF NOT EXIST DS_OUT.HEX GOTO EXITERROR

GOTO EXITOK


:BANKCODE

IF EXIST DS_OUT.COM.plg DEL DS_OUT.COM.plg

OC51 DS_OUT.ABS
IF ERRORLEVEL 1 GOTO EXITERROR

IF NOT EXIST DS_OUT.B00 GOTO EXITOK
OH51 DS_OUT.B00 HEXFILE (DS_OUT.H00)
DSCHECK.EXE /fDS_OUT.H00
IF NOT EXIST DS_OUT.H00 GOTO EXITERROR

IF NOT EXIST DS_OUT.B01 GOTO EXITOK
OH51 DS_OUT.B01 HEXFILE (DS_OUT.H01)
DSCHECK.EXE /fDS_OUT.H01
IF NOT EXIST DS_OUT.H01 GOTO EXITERROR

IF NOT EXIST DS_OUT.B02 GOTO EXITOK
OH51 DS_OUT.B02 HEXFILE (DS_OUT.H02)
DSCHECK.EXE /fDS_OUT.H02
IF NOT EXIST DS_OUT.H02 GOTO EXITERROR

IF NOT EXIST DS_OUT.B03 GOTO EXITOK
OH51 DS_OUT.B03 HEXFILE (DS_OUT.H03)
DSCHECK.EXE /fDS_OUT.H03
IF NOT EXIST DS_OUT.H03 GOTO EXITERROR

IF NOT EXIST DS_OUT.B04 GOTO EXITOK
OH51 DS_OUT.B04 HEXFILE (DS_OUT.H04)
DSCHECK.EXE /fDS_OUT.H04
IF NOT EXIST DS_OUT.H04 GOTO EXITERROR

IF NOT EXIST DS_OUT.B05 GOTO EXITOK
OH51 DS_OUT.B05 HEXFILE (DS_OUT.H05)
DSCHECK.EXE /fDS_OUT.H05
IF NOT EXIST DS_OUT.H05 GOTO EXITERROR

IF NOT EXIST DS_OUT.B06 GOTO EXITOK
OH51 DS_OUT.B06 HEXFILE (DS_OUT.H06)
DSCHECK.EXE /fDS_OUT.H06
IF NOT EXIST DS_OUT.H06 GOTO EXITERROR

IF NOT EXIST DS_OUT.B07 GOTO EXITOK
OH51 DS_OUT.B07 HEXFILE (DS_OUT.H07)
DSCHECK.EXE /fDS_OUT.H07
IF EXIST DS_OUT.H07 GOTO EXITOK


:EXITERROR
ECHO ********************************* ERROR FOUND *********************************


:EXITOK

IF EXIST DS_OUT.COM DEL DS_OUT.COM
IF EXIST DS_OUT.ABS DEL DS_OUT.ABS
IF EXIST DS_OUT.B0* DEL DS_OUT.B0*
IF EXIST *.__i DEL *.__i
